/* GUI CONVERTED from rcsdinit.p (converter v1.75) Sat Aug 12 23:01:38 2000 */
/* rcsdinit.p - Release Management Customer Schedules                   */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                  */
/* All rights reserved worldwide.  This is an unpublished work.         */
/*V8:ConvertMode=Maintenance                                            */
/*K1Q4*/ /*V8:RunMode=Character,Windows                                 */
/* REVISION: 8.6    LAST MODIFIED: 09/20/96           BY: TSI *K005*    */
/* REVISION: 8.6    LAST MODIFIED: 05/20/98           BY: *K1Q4* Alfred Tan */
/* REVISION: 8.6E   LAST MODIFIED: 01/01/2000         BY: *J3NH* Ashwini G  */
/* REVISION: 9.1    LAST MODIFIED: 08/12/00           BY: *N0KP* myb        */


          /* INITIALIZES A SCHEDULE DETAIL FROM ANOTHER */


/*J3NH*/ /* REPLACE THE LOGIC OF COPYING THROUGH 'NULL' STREAM BY */
/*J3NH*/ /* BUFFER-COPY STATEMENT                                 */

         /*INPUT PARAMETERS*/
         define input parameter prev_schd_recid as recid no-undo.
         define input parameter new_schd_recid as recid no-undo.

         /*LOCAL VARIABLES*/
         define variable new_index as integer no-undo.
         define variable i as integer no-undo.

         /*STREAMS*/
/*J3NH**  define stream nullout.  */

         /*BUFFERS*/
         define buffer cmtdet for cmt_det.
/*J3NH*/ define buffer b_schd_det for schd_det .

/*J3NH** BEGIN DELETE **
 *         find schd_det
 *            where recid(schd_det) = prev_schd_recid
 *            no-lock.
 *         {mfoutnul.i &stream_name=nullout}
 *
 *         display stream nullout
 *            schd_det.
 *J3NH** END DELETE **/

         find schd_det
            where recid(schd_det) = new_schd_recid
            exclusive-lock.

/*J3NH** BEGIN DELETE **
 *         display stream nullout
 *            schd_type
 *            schd_nbr
 *            schd_line
 *            schd_rlse_id
 *            schd_date
 *            schd_time
 *            schd_interval
 *            schd_reference.
 *
 *         assign
 *            schd_det.
 *J3NH** END DELETE **/

/*J3NH*/ for first b_schd_det
/*J3NH*/    where recid(b_schd_det) = prev_schd_recid no-lock:
/*J3NH*/ end.
/*J3NH*/ buffer-copy b_schd_det except schd_type schd_nbr schd_line
/*J3NH*/    schd_rlse_id schd_date schd_time schd_interval
/*J3NH*/    schd_reference to schd_det.

         /*COPY COMMENT DATA IF ANY*/
/*J3NH*/ /* QUALIFIED SCHD_CMTINDX WITH SCHD_DET. */
/*J3NH** if schd_cmtindx <> 0 then                */

/*J3NH*/ if schd_det.schd_cmtindx <> 0 then
         do:
             {gpcmtcpy.i
              &old_index = schd_det.schd_cmtindx
              &new_index = new_index
              &counter   = i}
              schd_det.schd_cmtindx = new_index.
          end.


/*J3NH**   output stream nullout close. */
